package com.sanxiau.dormitory.yang;

public class Son extends Father {
    public String name;
    private String school;

    public Son() {
        System.out.println("儿子的无参构造");
        name = "儿子";
    }


    public Son(String name, int age, double wage, String school) {
        super(name, age, wage);
        this.school = school;
        System.out.println("儿子的有参构造");
    }

    @Override
    public String getName() {
        return name;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    public static void work(){
        System.out.println("儿子上学");
    }

    @Override
    public void eat() {
        System.out.println("儿子吃饭");
    }
}
